package com.itljm.cxrMarket.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itljm.cxrMarket.entity.OrderItems;
import com.itljm.cxrMarket.entity.Orders;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itljm.cxrMarket.entity.Products;
import com.itljm.cxrMarket.entity.dto.OrderItemProductsDTO;
import com.itljm.cxrMarket.entity.dto.OrderStatusCountDTO;

import java.util.Date;
import java.util.List;

public interface OrdersService extends IService<Orders> {
    String insertOrder(Orders order, List<OrderItems> orderItems);
    boolean deleteOrderById(Integer orderId);
    Orders selectOrderById(Integer orderId);
    boolean updateOrderStatus(Integer orderId, Integer status, Date updateTime);
    List<Orders> selectAllOrdersPage(Page<Orders> page, Wrapper<Orders> entityWrapper);
    List<Orders> selectAllOrderByUserId(Page<Orders> page, Wrapper<Orders> entityWrapper, Long userId);
    OrderStatusCountDTO countOrderStatusByUserId(Long userId);
    List<OrderItemProductsDTO> selectOrders(Page<Orders> page,Integer status, Long userId);
    boolean isBuy(Long userId, Integer productId);

}
